/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg_entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Oswaldo
 */
@Entity
@Table(name = "saos_artiserv", catalog = "sisventas_db", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Artiserv.findAll", query = "SELECT a FROM Artiserv a"),
    @NamedQuery(name = "Artiserv.findByAosCodigo", query = "SELECT a FROM Artiserv a WHERE a.aosCodigo = :aosCodigo"),
    @NamedQuery(name = "Artiserv.findByAosTitulo", query = "SELECT a FROM Artiserv a WHERE a.aosTitulo = :aosTitulo"),
    @NamedQuery(name = "Artiserv.findByAosSubtit", query = "SELECT a FROM Artiserv a WHERE a.aosSubtit = :aosSubtit"),
    @NamedQuery(name = "Artiserv.findByAosPrecio", query = "SELECT a FROM Artiserv a WHERE a.aosPrecio = :aosPrecio"),
    @NamedQuery(name = "Artiserv.findByAosCantidad", query = "SELECT a FROM Artiserv a WHERE a.aosCantidad = :aosCantidad"),
    @NamedQuery(name = "Artiserv.findByAosDescri", query = "SELECT a FROM Artiserv a WHERE a.aosDescri = :aosDescri"),
    @NamedQuery(name = "Artiserv.findByAosTipo", query = "SELECT a FROM Artiserv a WHERE a.aosTipo = :aosTipo"),
    @NamedQuery(name = "Artiserv.findByAosFecha", query = "SELECT a FROM Artiserv a WHERE a.aosFecha = :aosFecha"),
    @NamedQuery(name = "Artiserv.findByAosTipogarant", query = "SELECT a FROM Artiserv a WHERE a.aosTipogarant = :aosTipogarant"),
    @NamedQuery(name = "Artiserv.findByAosTiemgarant", query = "SELECT a FROM Artiserv a WHERE a.aosTiemgarant = :aosTiemgarant")})
public class Artiserv implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "aos_codigo")
    private Integer aosCodigo;
    @Size(max = 75)
    @Column(name = "aos_titulo")
    private String aosTitulo;
    @Size(max = 100)
    @Column(name = "aos_subtit")
    private String aosSubtit;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "aos_precio")
    private BigDecimal aosPrecio;
    @Column(name = "aos_cantidad")
    private Integer aosCantidad;
    @Size(max = 2147483647)
    @Column(name = "aos_descri")
    private String aosDescri;
    @Column(name = "aos_tipo")
    private Character aosTipo;
    @Column(name = "aos_fecha")
    @Temporal(TemporalType.DATE)
    private Date aosFecha;
    @Column(name = "aos_tipogarant")
    private Character aosTipogarant;
    @Column(name = "aos_tiemgarant")
    private Integer aosTiemgarant;
    @Column(name = "aos_foto")
    private String aosFoto;
    @OneToMany(mappedBy = "aosCodigo")
    private List<Caracter> caracterList;
    @JoinColumn(name = "usr_codigo", referencedColumnName = "usr_codigo")
    @ManyToOne
    private Usuario usrCodigo;
    @JoinColumn(name = "top_codigo", referencedColumnName = "top_codigo")
    @ManyToOne
    private Tipoperac topCodigo;
    @JoinColumn(name = "cat_codigo", referencedColumnName = "cat_codigo")
    @ManyToOne
    private Categoria catCodigo;
    @OneToMany(mappedBy = "aosCodigo")
    private List<Operacion> operacionList;
    @OneToMany(mappedBy = "aosCodigo")
    private List<Preguntas> preguntasList;
    @OneToMany(mappedBy = "aosCodigo")
    private List<Fotos> fotosList;

    public Artiserv() {
    }

    public Artiserv(Integer aosCodigo) {
        this.aosCodigo = aosCodigo;
    }

    public String getAosFoto() {
        return aosFoto;
    }

    public void setAosFoto(String aosFoto) {
        this.aosFoto = aosFoto;
    }

    
    public Integer getAosCodigo() {
        return aosCodigo;
    }

    public void setAosCodigo(Integer aosCodigo) {
        this.aosCodigo = aosCodigo;
    }

    public String getAosTitulo() {
        return aosTitulo;
    }

    public void setAosTitulo(String aosTitulo) {
        this.aosTitulo = aosTitulo;
    }

    public String getAosSubtit() {
        return aosSubtit;
    }

    public void setAosSubtit(String aosSubtit) {
        this.aosSubtit = aosSubtit;
    }

    public BigDecimal getAosPrecio() {
        return aosPrecio;
    }

    public void setAosPrecio(BigDecimal aosPrecio) {
        this.aosPrecio = aosPrecio;
    }

    public Integer getAosCantidad() {
        return aosCantidad;
    }

    public void setAosCantidad(Integer aosCantidad) {
        this.aosCantidad = aosCantidad;
    }

    public String getAosDescri() {
        return aosDescri;
    }

    public void setAosDescri(String aosDescri) {
        this.aosDescri = aosDescri;
    }

    public Character getAosTipo() {
        return aosTipo;
    }

    public void setAosTipo(Character aosTipo) {
        this.aosTipo = aosTipo;
    }

    public Date getAosFecha() {
        return aosFecha;
    }

    public void setAosFecha(Date aosFecha) {
        this.aosFecha = aosFecha;
    }

    public Character getAosTipogarant() {
        return aosTipogarant;
    }

    public void setAosTipogarant(Character aosTipogarant) {
        this.aosTipogarant = aosTipogarant;
    }

    public Integer getAosTiemgarant() {
        return aosTiemgarant;
    }

    public void setAosTiemgarant(Integer aosTiemgarant) {
        this.aosTiemgarant = aosTiemgarant;
    }

    @XmlTransient
    public List<Caracter> getCaracterList() {
        return caracterList;
    }

    public void setCaracterList(List<Caracter> caracterList) {
        this.caracterList = caracterList;
    }

    public Usuario getUsrCodigo() {
        return usrCodigo;
    }

    public void setUsrCodigo(Usuario usrCodigo) {
        this.usrCodigo = usrCodigo;
    }

    public Tipoperac getTopCodigo() {
        return topCodigo;
    }

    public void setTopCodigo(Tipoperac topCodigo) {
        this.topCodigo = topCodigo;
    }

    public Categoria getCatCodigo() {
        return catCodigo;
    }

    public void setCatCodigo(Categoria catCodigo) {
        this.catCodigo = catCodigo;
    }

    @XmlTransient
    public List<Operacion> getOperacionList() {
        return operacionList;
    }

    public void setOperacionList(List<Operacion> operacionList) {
        this.operacionList = operacionList;
    }

    @XmlTransient
    public List<Preguntas> getPreguntasList() {
        return preguntasList;
    }

    public void setPreguntasList(List<Preguntas> preguntasList) {
        this.preguntasList = preguntasList;
    }

    @XmlTransient
    public List<Fotos> getFotosList() {
        return fotosList;
    }

    public void setFotosList(List<Fotos> fotosList) {
        this.fotosList = fotosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (aosCodigo != null ? aosCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Artiserv)) {
            return false;
        }
        Artiserv other = (Artiserv) object;
        if ((this.aosCodigo == null && other.aosCodigo != null) || (this.aosCodigo != null && !this.aosCodigo.equals(other.aosCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return aosTitulo;
    }
    
}
